package com.example.location.config;

import com.example.location.interceptor.MyInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class MyConfiguration implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new MyInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login.html")
                .excludePathPatterns("/login")
                .excludePathPatterns("/login/css/style.css")
                .excludePathPatterns("/login/img/1.jpg")
                .excludePathPatterns("/login/img/2.jpg")
                .excludePathPatterns("/error")
                .excludePathPatterns("/error/4xx.html")
                .excludePathPatterns("/error/404.html")
                .excludePathPatterns("/error/5xx.html")
                .excludePathPatterns("/login/img/favicon.ico");
    }
}
